demo: Add test for hide-titlebar-when-maximized
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 3 Dec 2011 00:46:53 +0000 (01:46 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 15 Dec 2011 15:31:57 +0000 (16:31 +0100)
Add an additional option to the appwindow demo to test the new
gtk-hide-titlebar-when-maximized setting.

https://bugzilla.gnome.org/show_bug.cgi?id=665616

demos/gtk-demo/appwindow.c

index 8f5dc3a3937bfbf266df9768265ecd21ff1c405e..583a2bbc6ad7dd74c3285d34b48b64b8655688b8 100644 (file)
@@ -29,6 +29,14 @@ activate_action (GtkAction *action)
                     NULL);
       return;
     }
+
+  if (g_str_equal (name, "HideTitlebar"))
+    {
+      gboolean value = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+      gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), value);
+      return;
+    }
+
   dialog = gtk_message_dialog_new (GTK_WINDOW (window),
                                    GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_INFO,
@@ -194,6 +202,11 @@ static GtkToggleActionEntry toggle_entries[] = {
     "Prefer Dark Theme",                       /* tooltip */
     G_CALLBACK (activate_action),
     FALSE },                                   /* is_active */
+  { "HideTitlebar", NULL,
+    "_Hide Titlebar when maximized", NULL,
+    "Hide Titlebar when maximized",
+    G_CALLBACK (activate_action),
+    FALSE }
 };
 static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
 
@@ -248,6 +261,7 @@ static const gchar *ui_info =
 "    </menu>"
 "    <menu action='PreferencesMenu'>"
 "      <menuitem action='DarkTheme'/>"
+"      <menuitem action='HideTitlebar'/>"
 "      <menu action='ColorMenu'>"
 "       <menuitem action='Red'/>"
 "       <menuitem action='Green'/>"